Language Support

Language Features

  • Variables (var, let)
  • Types (string, float, int, bool, undefined, function)
  • Boolean operators (||, &&, ==, !=, <, >, <=, >=)
  • Math operators (+, -, *, /, %)
  • String concatenation (+)
  • Assignment operators (++, --, +=, -=, *=, /=)
  • Comments (//, /* */)
  • Keywords (if, else, for, while, throw, break, continue)
  • Ternary operators (condition ? true : false)
  • Functions (function, return)
  • Arrow functions ((x) => { code; }, x => code)
  • Arrays (var x = [], var x = [values], x.add, x[index], x.length)
  • Maps (var x = {}, x["key"] = value, x.key = value)
  • Code blocks and lexical scopes ({, })
  • Try blocks (try, catch, finally)
  • Export and import values (import { x } from "Script Name", export var x = 0;)
  • Built in functions (JSON.parse(), JSON.stringify(), parseFloat(), parseInt())
  • Base prototype functions (.toString())

Notable Omissions

  • No foreach
  • No classes, prototypes
  • No way to use http, tcp, udp, etc.
  • No string interpolation (${value})
  • No iterators
  • No promises
  • No prototypes system
  • JSON only supports flat, strings-only JSON objects

Arrays

PropertyTypeNotes
lengthnumberHow many entries in the array
addfunction(*) => voidAdd a new value to the list
indexOffunction(*) => numberReturns the index in the list, or -1 if not found
[][number] => anyGet or set a value in the array

Strings

PropertyTypeNotes
lengthnumberHow many characters in string
startsWithfunction(string) => booleanWhether the string starts with the provided substring
endsWithfunction(string) => booleanWhether the string ends with the provided substring
containsfunction(string) => booleanWhether the string contains the provided substring